/**
 * 👨‍💻 伟谭
 * 📅 2017/11/27
 */

#import "TWConvenienceServiceDetailsCompanyDetailsCollectionViewCell.h"

@interface TWConvenienceServiceDetailsCompanyDetailsCollectionViewCell()

@property(nonatomic,strong) UILabel *lblCompayDetail;

@property(nonatomic,strong) UIButton *btnSeletAll;

@end

@implementation TWConvenienceServiceDetailsCompanyDetailsCollectionViewCell

#pragma mark - Class method

#pragma mark - Life cycle

#pragma mark - Override
- (instancetype)initWithFrame:(CGRect)frame {

    
    
    if(self){
    
        self = [super initWithFrame:frame];
        self.backgroundColor = [UIColor whiteColor];
        UILabel *lblCompayDetail = [UILabel hj_labelWithText:nil textColor:[UIColor grayColor] font:FontB(14.0f)];
        lblCompayDetail.contentMode = UIViewContentModeTop;
        
        NSString *contentStr = @"帮家公司就是提供帮家服务，组建成的搬家企业机构，其一般都有自己的专车，专人负责搬家。大型的搬家公司还要和客户签订协议等，收费方面，则参照搬家行驶里程、居住楼层高度、有没有尺寸冰箱、大屏电视、易碎品、高档家具等物品以及人工搬运距离等因素。";
        
        lblCompayDetail.attributedText = [NSAttributedString ls_changeLineAndTextSpaceWithTotalString:contentStr LineSpace:1.0f textSpace:0.5f];
        lblCompayDetail.numberOfLines = 0.0f;
        [self.contentView addSubview:lblCompayDetail];
        _lblCompayDetail = lblCompayDetail;
        
        
        
        UIButton *btnSeletAll = [UIButton hj_buttonWithTitle:@"查看全部" titleColor:[UIColor greenColor] font:FontB(14.0f) backgroundColor:nil touchUpInsideTarget:nil action:nil];
        UIImage *image = IMG(@"查看全部下");
        [btnSeletAll setImage:image forState:UIControlStateNormal];
 
        btnSeletAll.contentEdgeInsets = UIEdgeInsetsMake(4.0, 10.0f, 4.0f, 10.0f);
        
        btnSeletAll.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;
        btnSeletAll.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
        
        
         [btnSeletAll setTitleEdgeInsets:UIEdgeInsetsMake(0, 0.0f, 0, image.size.width)];
        
        [btnSeletAll setImageEdgeInsets:UIEdgeInsetsMake(0, btnSeletAll.titleLabel.bounds.size.width, 0.0, 0.0)];
        
        
        btnSeletAll.clipsToBounds = YES;
        btnSeletAll.layer.cornerRadius = 4.0f;
        btnSeletAll.layer.borderWidth =1.0f;
        btnSeletAll.layer.borderColor = [UIColor greenColor].CGColor;
        
        
        [self.contentView addSubview:btnSeletAll];
        _btnSeletAll = btnSeletAll;
        
        [lblCompayDetail mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.offset(6.0f);
            make.top.offset(5.0f);
            make.right.offset(-6.0f);
        }];
        
        [btnSeletAll mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.offset(0.0f);
            make.top.equalTo(lblCompayDetail.mas_bottom).offset(20.0f);
        }];
        
    }
    return self;
    
}

#pragma mark - Event response

#pragma mark - Protocol

#pragma mark <<#XXXDelegate#>>

#pragma mark - Public method

#pragma mark - Private method

#pragma mark - Getter & Setter

@end
